package o;

import android.content.Context;
import android.os.AsyncTask;
import android.text.TextUtils;
import com.huawei.appgallery.packagemanager.api.bean.ProfileTask;
import java.io.File;
import java.util.List;

public class cou extends AsyncTask<Void, Void, Void> {
    private Context ˊ;
    private String ˏ;

    protected /* synthetic */ Object doInBackground(Object[] objArr) {
        return ˋ((Void[]) objArr);
    }

    public cou(Context context, String str) {
        this.ˊ = context;
        this.ˏ = str;
    }

    protected Void ˋ(Void... voidArr) {
        ProfileTask profileTask;
        cor.ˎ(this.ˊ).ॱ();
        List<ProfileTask> ˊ = cor.ˎ(this.ˊ).ˊ(this.ˏ, null, null, null);
        if (!ˊ.isEmpty()) {
            cnu.ˏ.ˋ("ProfileDeleteTask", "delete profile:" + this.ˏ);
            for (ProfileTask profileTask2 : ˊ) {
                if (!TextUtils.isEmpty(profileTask2.profilePath)) {
                    File file = new File(profileTask2.profilePath);
                    if (file.exists() && !file.delete()) {
                        cnu.ˏ.ˊ("ProfileDeleteTask", "delete file failed." + profileTask2.profilePath);
                    }
                }
            }
            cor.ˎ(this.ˊ).ॱ(this.ˏ);
        }
        if (this.ˏ != null) {
            profileTask2 = (ProfileTask) coo.ॱ.remove(this.ˏ);
        } else {
            profileTask2 = null;
        }
        if (profileTask2 != null) {
            profileTask2.status = -1;
        }
        cor.ˎ(this.ˊ).ˏ();
        return null;
    }
}
